package net.learn.piggy.aware;

import org.springframework.context.annotation.ImportAware;
import org.springframework.context.weaving.LoadTimeWeaverAware;
import org.springframework.core.annotation.MergedAnnotations;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.instrument.classloading.LoadTimeWeaver;
import org.springframework.jmx.export.notification.NotificationPublisher;
import org.springframework.jmx.export.notification.NotificationPublisherAware;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletConfigAware;
import javax.servlet.ServletConfig;

@Component
public class OtherConfig implements LoadTimeWeaverAware, ImportAware,
        ServletConfigAware, NotificationPublisherAware {
    @Override
    public void setImportMetadata(AnnotationMetadata importMetadata) {
        MergedAnnotations annotations = importMetadata.getAnnotations();
        System.out.println("OtherConfig -- setImportMetadata");
    }

    // todo not invoke
    @Override
    public void setNotificationPublisher(NotificationPublisher notificationPublisher) {
        System.out.println("OtherConfig -- setNotificationPublisher");
    }

    // todo not invoke
    @Override
    public void setServletConfig(ServletConfig servletConfig) {
        System.out.println("OtherConfig -- setServletConfig");
    }

    @Override
    public void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver) {
        System.out.println("OtherConfig -- setLoadTimeWeaver");
    }

}